from typing import List


"""
给定一个未经排序的整数数组，找到最长且 连续递增的子序列，并返回该序列的长度。
https://leetcode.cn/problems/longest-continuous-increasing-subsequence/
"""
class Solution:
    def findLengthOfLCIS(self, nums: List[int]) -> int:
        n = len(nums)

        longest = 0
        curr = 1
        for i in range(1, n):
            if nums[i] > nums[i-1]:
                curr += 1
            else:
                longest = max(longest, curr)
                curr = 1
        longest = max(longest, curr)

        return longest
